#include "Decorator.h"


class Espresso :public Beverage
{
public:
	Espresso():m_descrption("Espresso")
	{

	}
	virtual ~Espresso()
	{

	}
	double cost()
	{
		return 1.99;
	}
	string GetDescrption() {return m_descrption;}
private:
	string m_descrption;
};

class HouseBlend:public Beverage
{
public:
	HouseBlend():m_descrption("HouseBlend")
	{

	}
	virtual ~HouseBlend()
	{

	}
	double cost()
	{
		return 0.89;
	}
	string GetDescrption() {return m_descrption;}
private:
	string m_descrption;
};

class Mocha:public CondimentBeverage
{
public:
	Mocha( Beverage* beverage):m_Beverage(beverage)
	{

	}

	string GetDescrption()
	{
		string temp = " ,Mocha";
		return m_Beverage->GetDescrption()+temp;
	}
	double cost()
	{
		return 0.20+m_Beverage->cost();
	}


private:
	Beverage* m_Beverage;
};



int main()
{
	
	Beverage* be = new Espresso();

	cout<<"original "<<be->GetDescrption()<<" $ "<<be->cost()<<endl;

	Beverage* be2 = new HouseBlend();
	be2 = new Mocha(be2);
	be2 = new Mocha(be2);
	string iresult = be2->GetDescrption();
	
	cout<<"Decorated "<<be2->GetDescrption()<<" $ "<<be2->cost()<<endl;

	delete be2;
	delete be;


	cin.get();
	return 0;
}
